home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
gnu
/
gawk
/
cawf2st.zoo
/
cawf.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-04-12
|
12KB
|
259 lines
/*
* cawf.h - definitions for cawf(1)
*/
/*
* Copyright (c) 1991 Purdue University Research Foundation,
* West Lafayette, Indiana 47907. All rights reserved.
*
* Written by Victor A. Abell <abe@mace.cc.purdue.edu>, Purdue
* University Computing Center. Not derived from licensed software;
* derived from awf(1) by Henry Spencer of the University of Toronto.
*
* Permission is granted to anyone to use this software for any
* purpose on any computer system, and to alter it and redistribute
* it freely, subject to the following restrictions:
*
* 1. The author is not responsible for any consequences of use of
* this software, even if they arise from flaws in it.
*
* 2. The origin of this software must not be misrepresented, either
* by explicit claim or by omission. Credits must appear in the
* documentation.
*
* 3. Altered versions must be plainly marked as such, and must not
* be misrepresented as being the original software. Credits must
* appear in the documentation.
*
* 4. This notice may not be removed or altered.
*/
#include <stdio.h>
#ifdef STDLIB
#include <stdlib.h>
#endif
#ifdef UNIX
#include <sys/types.h>
#else
#include <sys\types.h>
#endif
#include "regexp.h"
#include "cawflib.h"
#define ESC '\033' /* ESCape character */
#define MAXEXP 30 /* maximum expressions
* (and TABs) */
#define MAXFILES 10 /* maximum files (including
* *.dev, common and *.mac) */
#define MAXFSTK 5 /* maximum file stack
* (for .so) */
#define MAXHYCH 10 /* maximum hyphen characters */
#define MAXLINE 256 /* maximum line length */
#define MAXMACRO 100 /* maximum number of macros */
#define MAXMTXT 1024 /* maximum macro text lines */
#define MAXNHNR 10 /* maximum ".NH" numbers
* (but 0 not used) */
#define MAXNR 50 /* maximum number reg */
#define MAXOLL 512 /* maximum output line length */
#define MAXSCH 256 /* maximum special characters */
#define MAXSP 25 /* maximum stack pointer (for
* nesting of macro calls) */
#define MAXSTR 100 /* maximum ".ds" strings */
/*
* Output line adjustment modes
*/
#define LEFTADJ 0
#define RIGHTADJ 1
#define BOTHADJ 2
/*
* Error handling codes
*/
#define FATAL 0 /* fatal error */
#define LINE 0 /* display line */
#define NOLINE 1 /* don't display line */
#define WARN 1 /* warning error */
/*
* Padding directions
*/
#define PADLEFT 0 /* pad from left */
#define PADRIGHT 1 /* pad from right */
/*
* Pass 3 signal codes
*/
#define NOBREAK -1
#define DOBREAK -2
#define MESSAGE -3
/*
* Macro argument types
*/
#define MANMACROS 1 /* -man */
#define MSMACROS 2 /* -ms */
struct fcode {
char nm; /* font name character */
char status; /* status */
};
struct hytab {
char font; /* font name character */
int len; /* effective length */
char *str; /* value string */
};
struct macro {
char name[2]; /* macro name */
int bx; /* beginning Macrotxt[] index */
int ct; /* index count */
};
struct nbr {
char nm[2]; /* register name */
int val; /* value */
};
struct parms {
char nm[2]; /* parameter name */
char *cmd; /* pass 3 command */
int val; /* current value */
int prev; /* previous value */
};
struct rx {
char *re; /* regular expression */
struct regexp *pat; /* compiled pattern */
};
struct scale {
char nm; /* scale factor name */
double val; /* value */
};
struct schtab {
char nm[2]; /* character name */
int len; /* effective length */
char *str; /* value string */
};
struct str {
char nm[2]; /* string name */
char *str; /* string value */
};
extern int Adj; /* output line adjustment mode */
extern char *Aftnxt; /* action after next line */
extern char *Args[]; /* macro arguments */
extern char *Argstack[]; /* stack for Expand()'s "args[]" */
extern int Backc; /* last word ended with '\\c' */
extern int Botmarg; /* bottom margin */
extern int Centering; /* centering count */
extern int Condstack[]; /* stack for Expand()'s "cond" */
extern char *Cont; /* continue line append */
extern int Contlen; /* continue line append length */
extern int Curmx; /* current macro name */
extern int Divert; /* diversion status */
extern FILE *Efs; /* error file stream pointer */
extern char *Eol; /* end of line information */
extern int Eollen; /* end of line length */
extern int Err; /* error flag */
extern char *F; /* field value */
extern struct fcode Fcode[]; /* font codes */
extern int Fill; /* fill status */
extern char Font[]; /* current font */
extern char Fontout; /* font output mode */
extern int Fph; /* first page header status */
extern int Fsp; /* files stack pointer (for .so) */
extern char *Ftc; /* center footer */
extern char *Ftl; /* left footer */
extern char *Ftr; /* right footer */
extern char *Hdc; /* center header */
extern int Hdft; /* header/footer status */
extern char *Hdl; /* left header */
extern char *Hdr; /* right header */
extern FILE *Ifs; /* input file stream */
extern FILE *Ifs_stk[]; /* Ifs stack */
extern int Ind; /* indentation amount */
extern char *Inname; /* input file name */
extern char *Inn_stk[]; /* Inname stack */
extern struct hytab Hychar[]; /* hyphen characters */
extern int LL; /* line length */
extern char Line[]; /* input line */
extern int Lockil; /* pass 2 line number is locked
* (processing is inside macro) */
extern int Marg; /* macro argument - man, ms, etc. */
extern struct macro Macrotab[]; /* macro table */
extern int Macrostack[]; /* stack for Expand()'s "macro" */
extern char *Macrotxt[]; /* macro text */
extern int Mtx; /* macro text index */
extern int Mxstack[]; /* stack for Expand()'s "mx" */
extern int Nhnr[];